﻿
#ifndef IMAGEWND_H
#define IMAGEWND_H

#include <QWidget>
#include "SciData.h"
#include"qpainter.h"


class ImageWnd : public QWidget
{
    Q_OBJECT
public:
    explicit ImageWnd(QWidget *parent = nullptr);

    ~ImageWnd();

    void resizeEvent(QResizeEvent *event);

    virtual bool nativeEvent(const QByteArray &eventType, void *message, long *result) override;

    virtual void mousePressEvent(QMouseEvent* event) override;

    //显示图片
    long ShowSciImage(SciImage img);

    //画ROI
    long DrawSciROI(SciROI roi);

    //画overlay
    long DrawSciOverlay(SciOverlay overlay);

    //画overlayPath
    long DrawSciOverlayPath(SciOverlayPath overlayPath);

    //画静态图层overlay
    long DrawSciStaticOverlay(SciOverlay overlay);

    //画静态图层overlayPath
    long DrawSciStaticOverlayPath(SciOverlayPath overlayPath);

    //清除所有ROI
    long ClearAllROI();

    //清除 overlay
    long ClearOverlay(long overlayID);

    //清除所有overlay
    long ClearAllOverlay();

    //清除所有静态图层overlay
    long ClearAllStaticOverlay();

    //获取图像编辑区的截图
    long GetSciScreenShot(QString path);

    //获取图像编辑区的截图
    long GetSciScreenShot(SciImage& img);
    
    long GetCurrentImage(SciImage& img);

    //<! overlay 和roi都禁止移动
    long DisableMoveOverlay();


signals:
    void sig_Shape_changed(long long);
    void sig_Shape_Hit(long long);
	void sig_NoShape_Hit();
    void sig_Mouse_Release(long long);
    //<! 刷新窗口
    void sig_RefreshWnd();
    // 左键双击
    void sig_LeftMouseBtbDClick();
private slots:
    void LoadImageFromLocal();
    void ExportImageToLocal();
    void ExportShotImage();
    void ShowMenu();
    

public:
    long long ImgWndID; //

};

#endif // IMAGEWND_H
